package com.yuyou.tas.admin.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yuyou.tas.admin.service.IOfficeTokenService;
import com.yuyou.tas.service.api.admin.dto.OfficeTokenDTO;
import com.yuyou.tas.service.api.admin.service.OfficeTokenAPI;
import com.yuyou.tas.util.bean.ResBoolSimpleInfo;

@RestController
public class OfficeTokenAPIImpl implements 	OfficeTokenAPI{

	
	@Autowired
	private IOfficeTokenService officeTokenService;
	
	@Override
	public ResBoolSimpleInfo<OfficeTokenDTO> editNoCheck(@RequestParam("resourceId") String resourceId) throws Exception {

		
		OfficeTokenDTO officeTokenDTO=officeTokenService.editNoCheck(resourceId);
		ResBoolSimpleInfo<OfficeTokenDTO> res=new ResBoolSimpleInfo<OfficeTokenDTO>();
		res.setData(officeTokenDTO);
		res.setSuccess(true);
		return res;
	}
	@Override
	public ResBoolSimpleInfo<String> hasResourcePer(@RequestParam("organId")Long organId,@RequestParam("type")Integer type){
		return officeTokenService.resFuncLim(organId, type);
	}
	
}
